package vista;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import controlador.Controlador;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ventGenerarPrediccionMuerte extends javax.swing.JFrame {
	private JLabel lblPeriodoInicial;
	private JLabel lblCategoria;
	private JButton btnCancelar;
	private JTextArea txtAreaPrediccionMuerte;
	private JLabel lblPrediccion;
	private JButton btnGenerarPrediccionMuerte;
	private JTextField txtCategoria;
	private JTextField txtPeriodoFinal;
	private JTextField txtPeriodoInicial;
	private JLabel lblPeriodoFinal;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public ventGenerarPrediccionMuerte() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Generar Prediccion de Muerte");
			getContentPane().setLayout(null);
			{
				lblPeriodoInicial = new JLabel();
				getContentPane().add(lblPeriodoInicial);
				lblPeriodoInicial.setText("Periodo Inicial");
				lblPeriodoInicial.setBounds(55, 47, 98, 14);
			}
			{
				lblPeriodoFinal = new JLabel();
				getContentPane().add(lblPeriodoFinal);
				lblPeriodoFinal.setText("Periodo Final");
				lblPeriodoFinal.setBounds(55, 90, 98, 14);
			}
			{
				lblCategoria = new JLabel();
				getContentPane().add(lblCategoria);
				lblCategoria.setText("Categoria");
				lblCategoria.setBounds(55, 135, 98, 14);
			}
			{
				txtPeriodoInicial = new JTextField();
				getContentPane().add(txtPeriodoInicial);
				txtPeriodoInicial.setBounds(165, 40, 142, 21);
			}
			{
				txtPeriodoFinal = new JTextField();
				getContentPane().add(txtPeriodoFinal);
				txtPeriodoFinal.setBounds(165, 87, 142, 21);
			}
			{
				txtCategoria = new JTextField();
				getContentPane().add(txtCategoria);
				txtCategoria.setBounds(165, 132, 142, 21);
			}
			{
				btnGenerarPrediccionMuerte = new JButton();
				getContentPane().add(btnGenerarPrediccionMuerte);
				btnGenerarPrediccionMuerte.setText("Generar Prediccion de Muerte");
				btnGenerarPrediccionMuerte.setBounds(343, 40, 228, 21);
				btnGenerarPrediccionMuerte.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						Controlador controlador = new Controlador();
						txtAreaPrediccionMuerte.append(controlador.getInstancia().generarPrediccionMuerte(txtPeriodoInicial.getText(), txtPeriodoFinal.getText(), txtCategoria.getText()));
					}
				});
			}
			{
				btnCancelar = new JButton();
				getContentPane().add(btnCancelar);
				btnCancelar.setText("Cancelar");
				btnCancelar.setBounds(343, 83, 228, 21);
				btnCancelar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						dispose();			
					}
				});
			}
			{
				lblPrediccion = new JLabel();
				getContentPane().add(lblPrediccion);
				lblPrediccion.setText("Prediccion");
				lblPrediccion.setBounds(55, 198, 98, 14);
			}
			{
				txtAreaPrediccionMuerte = new JTextArea();
				getContentPane().add(txtAreaPrediccionMuerte);
				txtAreaPrediccionMuerte.setBounds(55, 224, 389, 88);
			}
			pack();
			this.setSize(619, 403);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
